home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr10
/
snr503.zip
/
EVERY5.S
< prev
next >
Wrap
Text File
|
1993-05-30
|
921b
|
18 lines
\ EVERY5.S
\ Here's an example of how to use flags to do some rudimentary
\ counting. This table will insert a "peek-a-boo" message in the
\ output file every five lines.
\ Note that this concept is not limited to counting carriage returns;
\ you can count any character string using this method (such as tabs).
\ You can get real fancy by combining the 16 available flags to count
\ higher than 16. For example, by chaining flags in a binary progression,
\ you can use 6 flags to count up to 64, 7 flags to count up to 128, etc.
\ That would get somewhat complex, though.
\0d\0a*00=\0d\0a*11 \ CRLF and flag 0 OFF, turn flag 1 ON
\0d\0a*11=\0d\0a*21 \ CRLF and flag 1 ON, turn flag 2 ON
\0d\0a*21=\0d\0a*31 \ CRLF and flag 2 ON, turn flag 3 ON
\0d\0a*31=\0d\0a*41 \ CRLF and flag 3 ON, turn flag 4 ON
\0d\0a*41=\0d\0a<PEEK-A-BOO!>\0d\0a*00*10*20*30*40 \ turn all flags OFF